<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
      'use strict'

      //if判断
      let age=3;
      if(age>18){
        alert("old")
      }else{
        alert("young")
      }

      //while循环
      while(age<18){
        age= age+1;
        console.log(age);
      }

      //for循环
      for (let i = 0; i < 10; i++) {
        console.log(i)
      }

      //do while遍历数组
      do{
        age=age+1;
        console.log(age);
      }
      while(age<100)

      //forEach数组循环
      var ages =[1,2,3,4,5,6,78,9,4,3124,12,"www"]
      ages.forEach(function (value){
        console.log(value)
      })
    //函数
      /**
       * for(Type str:el){}
       */
      for(var num in ages){
        if(ages.hasOwnProperty(num)) {
          console.log("存在")
          console.log(age[num])
        }
      }
    </script>
</head>
<body>

</body>
</html>